/*

*** This do file creates the replication results for 

Environmentalism, Democracy, and Pollution Control (with Richard Damiana, Per G. Fredriksson and Scott Gates), Journal of Environmental Economics and Management, 49 (2), 2005, pp. 343-365

Eric Neumayer (LSE)																			

Please report any errors to e.neumayer@lse.ac.uk

*/

use "Article for JEEM.dta", replace


* Table 2
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos1997, robust
ovtest
outreg using c:\table1, replace 3aster se  coefastr 
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos1997,
tobit leadcontent leadvehicles1996pc lngdp1996 participcentered competitioncentered partcomp engos1997, ll(0)
outreg using c:\table1, append 3aster se  coefastr 
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos1997 if fsdevelop==0, robust
ovtest
outreg using c:\table1, append 3aster se  coefastr 
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos1997 if fsdevelop==0,
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos1997 if engos1997>=3, robust
ovtest
outreg using c:\table1, append 3aster se  coefastr 
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos1997 if engos1997>=3,
ivreg2 leadcontent  lngdp1996 participcentered competitioncentered partcomp (engos1997 leadvehicles1996pc = lnPOP muslim confuci english german french scand social), robust
outreg using c:\table1, append 3aster se  coefastr 
ivreg2 leadcontent  lngdp1996 participcentered competitioncentered partcomp (engos1997 leadvehicles1996pc = lnPOP muslim confuci english german french scand social), 
ivendog


preserve
quietly  xi: fit leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos1997 
capture drop dfits
fpredict dfits, dfits
gsort -dfits
* list name dfits shcode6 if dfits~=.
capture drop excl1
generate excl1=0
replace excl1=1 if abs(dfits)> 2*((_result(3)+1)/(_result(1)))^(1/2)
list name dfits if dfits~=. & excl1==1
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos1997 if excl1!=1, robust
ovtest
outreg using c:\table1, append 3aster se  coefastr 
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos1997 if excl1!=1,
ivreg2 leadcontent  lngdp1996 participcentered competitioncentered partcomp (engos1997 leadvehicles1996pc = lnPOP muslim confuci english german french scand social) if excl1!=1, robust
ivreg2 leadcontent  lngdp1996 participcentered competitioncentered partcomp (engos1997 leadvehicles1996pc = lnPOP muslim confuci english german french scand social) if excl1!=1, 
ivendog
restore


preserve
quietly  xi: fit leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos1997 if fsdevelop==0
capture drop dfits
fpredict dfits, dfits
gsort -dfits
* list name dfits shcode6 if dfits~=.
capture drop excl1
generate excl1=0
replace excl1=1 if abs(dfits)> 2*((_result(3)+1)/(_result(1)))^(1/2)
list name dfits if dfits~=. & excl1==1
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos1997 if fsdevelop==0 & excl1!=1, robust
outreg using c:\table1, append 3aster se  coefastr 
ovtest
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos1997 if fsdevelop==0 & excl1!=1,
ivreg2 leadcontent  lngdp1996 participcentered competitioncentered partcomp (engos1997 leadvehicles1996pc = lnPOP muslim confuci english german french scand social) if fsdevelop==0 & excl1!=1, robust
ivreg2 leadcontent  lngdp1996 participcentered competitioncentered partcomp (engos1997 leadvehicles1996pc = lnPOP muslim confuci english german french scand social) if fsdevelop==0 & excl1!=1, 
ivendog
restore

* Table 3
reg leadcontent leadvehicles1993pc  lngdp1993 participcentered competitioncentered partcomp engos1994, robust
outreg using c:\table1, replace 3aster se  coefastr 
reg leadcontent leadvehicles1993pc  lngdp1993 participcentered competitioncentered partcomp engos1994,
tobit leadcontent leadvehicles1993pc lngdp1993 participcentered competitioncentered partcomp engos1994, ll(0)
outreg using c:\table1, append 3aster se  coefastr 
reg leadcontent leadvehicles1993pc  lngdp1993 participcentered competitioncentered partcomp engos1994 if fsdevelop==0, robust
outreg using c:\table1, append 3aster se  coefastr 
reg leadcontent leadvehicles1993pc  lngdp1993 participcentered competitioncentered partcomp engos1994 if fsdevelop==0,
reg leadcontent leadvehicles1993pc  lngdp1993 participcentered competitioncentered partcomp engos1994 if engos1994>=2, robust
outreg using c:\table1, append 3aster se  coefastr 
reg leadcontent leadvehicles1993pc  lngdp1993 participcentered competitioncentered partcomp engos1994 if engos1994>=2,

ivreg2 leadcontent  lngdp1993 participcentered competitioncentered partcomp (engos1994 leadvehicles1993pc = lnPOP muslim confuci english german french scand social), robust
outreg using c:\table1, append 3aster se  coefastr 
ivreg2 leadcontent  lngdp1993 participcentered competitioncentered partcomp (engos1994 leadvehicles1993pc = lnPOP muslim confuci english german french scand social), 
ivendog



preserve
quietly  xi: fit leadcontent leadvehicles1993pc  lngdp1993 participcentered competitioncentered partcomp engos1994 
capture drop dfits
fpredict dfits, dfits
gsort -dfits
* list name dfits shcode6 if dfits~=.
capture drop excl1
generate excl1=0
replace excl1=1 if abs(dfits)> 2*((_result(3)+1)/(_result(1)))^(1/2)
list name dfits if dfits~=. & excl1==1
reg leadcontent leadvehicles1993pc  lngdp1993 participcentered competitioncentered partcomp engos1994 if excl1!=1, robust
ovtest
outreg using c:\table1, append 3aster se  coefastr 
reg leadcontent leadvehicles1993pc  lngdp1993 participcentered competitioncentered partcomp engos1994 if excl1!=1,
ivreg2 leadcontent  lngdp1993 participcentered competitioncentered partcomp (engos1994 leadvehicles1993pc = lnPOP muslim confuci english german french scand social) if excl1!=1, robust
ivreg2 leadcontent  lngdp1993 participcentered competitioncentered partcomp (engos1994 leadvehicles1993pc = lnPOP muslim confuci english german french scand social) if excl1!=1, 
ivendog
restore


preserve
quietly  xi: fit leadcontent leadvehicles1993pc  lngdp1993 participcentered competitioncentered partcomp engos1994 if fsdevelop==0
capture drop dfits
fpredict dfits, dfits
gsort -dfits
* list name dfits shcode6 if dfits~=.
capture drop excl1
generate excl1=0
replace excl1=1 if abs(dfits)> 2*((_result(3)+1)/(_result(1)))^(1/2)
list name dfits if dfits~=. & excl1==1
reg leadcontent leadvehicles1993pc  lngdp1993 participcentered competitioncentered partcomp engos1994 if fsdevelop==0 & excl1!=1, robust
ovtest
outreg using c:\table1, append 3aster se  coefastr 
reg leadcontent leadvehicles1993pc  lngdp1993 participcentered competitioncentered partcomp engos1994 if fsdevelop==0 & excl1!=1,
ivreg2 leadcontent  lngdp1993 participcentered competitioncentered partcomp (engos1994 leadvehicles1993pc = lnPOP muslim confuci english german french scand social) if fsdevelop==0 & excl1!=1, robust
ivreg2 leadcontent  lngdp1993 participcentered competitioncentered partcomp (engos1994 leadvehicles1993pc = lnPOP muslim confuci english german french scand social) if fsdevelop==0 & excl1!=1, 
ivendog
restore





* Table 4
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos2001corrected, robust
ovtest
outreg using c:\table1, replace 3aster se  coefastr 
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos2001corrected,
tobit leadcontent leadvehicles1996pc lngdp1996 participcentered competitioncentered partcomp engos2001corrected, ll(0)
outreg using c:\table1, append 3aster se  coefastr 
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos2001corrected if fsdevelop==0, robust
ovtest
outreg using c:\table1, append 3aster se  coefastr 
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos2001corrected if fsdevelop==0,
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos2001corrected if engos2001corrected>=3, robust
ovtest
outreg using c:\table1, append 3aster se  coefastr 
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos2001corrected if engos2001corrected>=3,

ivreg2 leadcontent  lngdp1996 participcentered competitioncentered partcomp (engos2001corrected leadvehicles1996pc = lnPOP muslim confuci english german french scand social), robust
outreg using c:\table1, append 3aster se  coefastr 
ivreg2 leadcontent  lngdp1996 participcentered competitioncentered partcomp (engos2001corrected leadvehicles1996pc = lnPOP muslim confuci english german french scand social), 
ivendog


preserve
quietly  xi: fit leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos2001corrected 
capture drop dfits
fpredict dfits, dfits
gsort -dfits
* list name dfits shcode6 if dfits~=.
capture drop excl1
generate excl1=0
replace excl1=1 if abs(dfits)> 2*((_result(3)+1)/(_result(1)))^(1/2)
list name dfits if dfits~=. & excl1==1
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos2001corrected if excl1!=1, robust
ovtest
outreg using c:\table1, append 3aster se  coefastr 
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos2001corrected if excl1!=1,
ivreg2 leadcontent  lngdp1996 participcentered competitioncentered partcomp (engos2001corrected leadvehicles1996pc = lnPOP muslim confuci english german french scand social) if excl1!=1, robust
ivreg2 leadcontent  lngdp1996 participcentered competitioncentered partcomp (engos2001corrected leadvehicles1996pc = lnPOP muslim confuci english german french scand social) if excl1!=1, 
ivendog
restore


preserve
quietly  xi: fit leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos2001corrected if fsdevelop==0
capture drop dfits
fpredict dfits, dfits
gsort -dfits
* list name dfits shcode6 if dfits~=.
capture drop excl1
generate excl1=0
replace excl1=1 if abs(dfits)> 2*((_result(3)+1)/(_result(1)))^(1/2)
list name dfits if dfits~=. & excl1==1
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos2001corrected if fsdevelop==0 & excl1!=1, robust
ovtest
outreg using c:\table1, append 3aster se  coefastr 
reg leadcontent leadvehicles1996pc  lngdp1996 participcentered competitioncentered partcomp engos2001corrected if fsdevelop==0 & excl1!=1,
ivreg2 leadcontent  lngdp1996 participcentered competitioncentered partcomp (engos2001corrected leadvehicles1996pc = lnPOP muslim confuci english german french scand social) if fsdevelop==0 & excl1!=1, robust
ivreg2 leadcontent  lngdp1996 participcentered competitioncentered partcomp (engos2001corrected leadvehicles1996pc = lnPOP muslim confuci english german french scand social) if fsdevelop==0 & excl1!=1, 
ivendog
restore


